home *** CD-ROM | disk | FTP | other *** search
/ Freelog 117 / FreelogNo117-OctobreNovembre2013.iso / Programmation / jedit / jedit5.1.0install.exe / {app} / modes / scala.xml < prev    next >
Extensible Markup Language  |  2013-07-28  |  10KB  |  306 lines

  1. <?xml version="1.0"?>
  2. <!-- Scala mode by Daniel Spiewak downloaded on 2012-03-10 from https://github.com/djspiewak/jedit-modes/blob/master/scala.xml -->
  3. <!DOCTYPE MODE SYSTEM "xmode.dtd">
  4. <MODE>
  5.   <PROPS>
  6.     <PROPERTY NAME="indentOpenBrackets" VALUE="{" />
  7.     <PROPERTY NAME="indentCloseBrackets" VALUE="}" />
  8.     <PROPERTY NAME="lineUpClosingBracket" VALUE="true" />
  9. <PROPERTY NAME="indentNextLine"
  10. VALUE="(.*((if|while|else\s+if|for)\s*\().*\)|\s*else|\s*case.*=>|.*(def|val|var|type).*=)\s*$"/>
  11.     <!-- set this to 'true' if you want to use GNU coding style -->
  12.     <PROPERTY NAME="doubleBracketIndent" VALUE="false" />
  13.     <PROPERTY NAME="commentStart" VALUE="/*" />
  14.     <PROPERTY NAME="commentEnd" VALUE="*/" />
  15.     <PROPERTY NAME="lineComment" VALUE="//" />
  16.     <PROPERTY NAME="noTabs" VALUE="true" />
  17.     <PROPERTY NAME="tabSize" VALUE="2" />
  18.     <PROPERTY NAME="indentSize" VALUE="2" />
  19.     <PROPERTY NAME="wordBreakChars" VALUE=",+-=<>/?^&*" />
  20.   </PROPS>
  21.   
  22.   <RULES IGNORE_CASE="FALSE" HIGHLIGHT_DIGITS="TRUE"
  23.    DIGIT_RE="(0[lL]?|[1-9]\d{0,9}(\d{0,9}[lL])?|0[xX]\p{XDigit}{1,8}(\p{XDigit}{0,8}[lL])?|0[0-7]{1,11}([0-7]{0,11}[lL])?|([0-9]+\.[0-9]*|\.[0-9]+)([eE][+-]?[0-9]+)?[fFdD]?|[0-9]+([eE][+-]?[0-9]+[fFdD]?|([eE][+-]?[0-9]+)?[fFdD]))">
  24.  
  25. <MARK_FOLLOWING TYPE="LABEL">@</MARK_FOLLOWING>
  26.  
  27. <IMPORT DELEGATE="PRIMARY"/>
  28.   </RULES>
  29.   
  30.   <RULES SET="PRIMARY">
  31.     <!-- Silly comment -->
  32.     <SEQ TYPE="COMMENT1">/**/</SEQ>
  33.  
  34.     <EOL_SPAN TYPE="COMMENT2">//</EOL_SPAN>
  35.  
  36.     <!-- Scaladoc comment -->
  37.     <SPAN TYPE="COMMENT3" DELEGATE="SCALADOC">
  38.       <BEGIN>/**</BEGIN>
  39.       <END>*/</END>
  40.     </SPAN>
  41.  
  42.     <!-- Scala comment (Java style) -->
  43.     <SPAN TYPE="COMMENT1">
  44.       <BEGIN>/*</BEGIN>
  45.       <END>*/</END>
  46.     </SPAN>
  47.     
  48.     <SPAN MATCH_TYPE="NULL" DELEGATE="MAIN">
  49.      <BEGIN>{</BEGIN>
  50.      <END>}</END>
  51.     </SPAN>
  52.     
  53.     <!-- XML literals; keep this in sync with the XML_LITERAL rule set! -->
  54.    <IMPORT DELEGATE="XML_SHARED"/>
  55.  
  56.     <!-- string and character literals -->
  57.     <SPAN TYPE="LITERAL1" NO_LINE_BREAK="FALSE" ESCAPE="FALSE">
  58.       <BEGIN>"""</BEGIN>
  59.       <END>"""</END>
  60.     </SPAN>
  61.     <SPAN TYPE="LITERAL1" NO_LINE_BREAK="TRUE" ESCAPE="\">
  62.       <BEGIN>"</BEGIN>
  63.       <END>"</END>
  64.     </SPAN>
  65. <SEQ_REGEXP HASH_CHAR="'" TYPE="LITERAL1">'([^'\\]|\\.)'</SEQ_REGEXP>
  66.  
  67.     <!-- symbol literals -->
  68.     <SEQ_REGEXP HASH_CHAR="'" TYPE="LABEL">'[0-9a-zA-Z><=+]([0-9a-zA-Z><=+]|_[0-9a-zA-Z><=+])*</SEQ_REGEXP>
  69.  
  70.     <SPAN MATCH_TYPE="LITERAL3" DELEGATE="TYPE_PARAMS">
  71. <BEGIN>[</BEGIN>
  72. <END>]</END>
  73. </SPAN>
  74.  
  75. <SPAN MATCH_TYPE="NULL">
  76. <BEGIN>`</BEGIN>
  77. <END>`</END>
  78. </SPAN>
  79.  
  80.     <SEQ TYPE="OPERATOR">(</SEQ>
  81.     <SEQ TYPE="OPERATOR">)</SEQ>
  82.     <SEQ TYPE="OPERATOR">}</SEQ>
  83.     <SEQ TYPE="OPERATOR">{</SEQ>
  84.     <SEQ TYPE="NULL">.</SEQ>
  85.     <SEQ TYPE="NULL">,</SEQ>
  86.     <SEQ TYPE="NULL">;</SEQ>
  87.     <SEQ TYPE="NULL">:</SEQ>
  88.  
  89.     <!-- Function calls -->
  90.     <!-- <MARK_PREVIOUS TYPE="FUNCTION" MATCH_TYPE="OPERATOR">(</MARK_PREVIOUS> -->
  91.  
  92. <!-- Function declarations (overloaded for different spacing styles)-->
  93. <MARK_FOLLOWING TYPE="FUNCTION" MATCH_TYPE="KEYWORD1" AT_WORD_START="TRUE">def </MARK_FOLLOWING>
  94. <MARK_FOLLOWING TYPE="FUNCTION" MATCH_TYPE="KEYWORD1" AT_WORD_START="TRUE">def </MARK_FOLLOWING>
  95. <MARK_FOLLOWING TYPE="FUNCTION" MATCH_TYPE="KEYWORD1" AT_WORD_START="TRUE">def </MARK_FOLLOWING>
  96. <MARK_FOLLOWING TYPE="FUNCTION" MATCH_TYPE="KEYWORD1" AT_WORD_START="TRUE">def </MARK_FOLLOWING>
  97. <MARK_FOLLOWING TYPE="FUNCTION" MATCH_TYPE="KEYWORD1" AT_WORD_START="TRUE">def </MARK_FOLLOWING>
  98. <MARK_FOLLOWING TYPE="FUNCTION" MATCH_TYPE="KEYWORD1" AT_WORD_START="TRUE">def </MARK_FOLLOWING>
  99. <MARK_FOLLOWING TYPE="FUNCTION" MATCH_TYPE="KEYWORD1" AT_WORD_START="TRUE">def </MARK_FOLLOWING>
  100.  
  101. <SPAN DELEGATE="PATTERN" MATCH_TYPE="KEYWORD1" AT_WORD_START="TRUE" NO_LINE_BREAK="TRUE">
  102. <BEGIN>case </BEGIN>
  103. <END>=></END>
  104. </SPAN>
  105.  
  106.     <KEYWORDS>
  107.       <KEYWORD1>abstract</KEYWORD1>
  108.       <KEYWORD1>case</KEYWORD1>
  109.       <KEYWORD1>catch</KEYWORD1>
  110.       <KEYWORD1>class</KEYWORD1>
  111.       <KEYWORD1>def</KEYWORD1>
  112.       <KEYWORD1>do</KEYWORD1>
  113.       <KEYWORD1>else</KEYWORD1>
  114.       <KEYWORD1>extends</KEYWORD1>
  115.       <KEYWORD1>final</KEYWORD1>
  116.       <KEYWORD1>finally</KEYWORD1>
  117.       <KEYWORD1>for</KEYWORD1>
  118.       <KEYWORD1>forSome</KEYWORD1>
  119.       <KEYWORD1>if</KEYWORD1>
  120.       <KEYWORD1>implicit</KEYWORD1>
  121.       <KEYWORD1>import</KEYWORD1>
  122.       <KEYWORD1>lazy</KEYWORD1>
  123.       <KEYWORD1>match</KEYWORD1>
  124.       <KEYWORD1>new</KEYWORD1>
  125.       <KEYWORD1>object</KEYWORD1>
  126.       <KEYWORD1>override</KEYWORD1>
  127.       <KEYWORD1>package</KEYWORD1>
  128.       <KEYWORD1>private</KEYWORD1>
  129.       <KEYWORD1>protected</KEYWORD1>
  130.       <KEYWORD1>requires</KEYWORD1>
  131.       <KEYWORD1>return</KEYWORD1>
  132.       <KEYWORD1>sealed</KEYWORD1>
  133.       <KEYWORD1>throw</KEYWORD1>
  134.       <KEYWORD1>trait</KEYWORD1>
  135.       <KEYWORD1>try</KEYWORD1>
  136.       <KEYWORD1>type</KEYWORD1>
  137.       <KEYWORD1>val</KEYWORD1>
  138.       <KEYWORD1>var</KEYWORD1>
  139.       <KEYWORD1>with</KEYWORD1>
  140.       <KEYWORD1>while</KEYWORD1>
  141.       <KEYWORD1>yield</KEYWORD1>
  142.       <KEYWORD1>=></KEYWORD1>
  143.  
  144.       <!-- java.lang.* wrapper types -->
  145.       <KEYWORD2>Character</KEYWORD2>
  146.       <KEYWORD2>Integer</KEYWORD2>
  147.  
  148.       <!-- scala.* primitive types -->
  149.       <KEYWORD2>Boolean</KEYWORD2>
  150.       <KEYWORD2>Byte</KEYWORD2>
  151.       <KEYWORD2>Char</KEYWORD2>
  152.       <KEYWORD2>Double</KEYWORD2>
  153.       <KEYWORD2>Float</KEYWORD2>
  154.       <KEYWORD2>Int</KEYWORD2>
  155.       <KEYWORD2>Long</KEYWORD2>
  156.       <KEYWORD2>Short</KEYWORD2>
  157.       <KEYWORD2>Unit</KEYWORD2>
  158.  
  159.       <!-- scala.* predefined types -->
  160.       <KEYWORD3>Any</KEYWORD3>
  161.       <KEYWORD3>AnyRef</KEYWORD3>
  162.       <KEYWORD3>Nothing</KEYWORD3>
  163.  
  164. <LITERAL2>false</LITERAL2>
  165. <LITERAL2>null</LITERAL2>
  166. <LITERAL2>super</LITERAL2>
  167. <LITERAL2>this</LITERAL2>
  168. <LITERAL2>true</LITERAL2>
  169.     </KEYWORDS>
  170.   </RULES>
  171.   
  172.   <RULES SET="TYPE_PARAMS" DEFAULT="LITERAL3">
  173.    <SPAN MATCH_TYPE="LITERAL3" DELEGATE="TYPE_PARAMS">
  174. <BEGIN>[</BEGIN>
  175. <END>]</END>
  176. </SPAN>
  177.   </RULES>
  178.   
  179.   <RULES SET="PATTERN" DEFAULT="NULL" IGNORE_CASE="FALSE">
  180.    <IMPORT DELEGATE="PRIMARY"/>
  181.  
  182. <SEQ TYPE="OPERATOR">@</SEQ>
  183.   </RULES>
  184.  
  185.   <RULES SET="SCALADOC" DEFAULT="COMMENT3" IGNORE_CASE="TRUE">
  186.     <!-- so that @link{...} is highlighted -->
  187.     <SEQ TYPE="COMMENT3">{</SEQ>
  188.  
  189.     <!-- so that *@param is highlighted -->
  190.     <SEQ TYPE="COMMENT3">*</SEQ>
  191.  
  192.     <!-- Javadoc ignores tags inside <pre> -->
  193.     <SPAN TYPE="MARKUP" DELEGATE="SCALADOC_PRE">
  194.       <BEGIN><pre></BEGIN>
  195.       <END></pre></END>
  196.     </SPAN>
  197.  
  198.     <!-- HTML comments -->
  199.     <SPAN TYPE="COMMENT1">
  200.       <BEGIN><!--</BEGIN>
  201.       <END>--></END>
  202.     </SPAN>
  203.  
  204.     <!-- HTML tags -->
  205.     <SPAN_REGEXP HASH_CHAR="<" TYPE="MARKUP" DELEGATE="xml::TAGS" NO_LINE_BREAK="TRUE">
  206.       <BEGIN></?[\da-zA-Z\-]+</BEGIN>
  207.       <END>></END>
  208.     </SPAN_REGEXP>
  209.  
  210.     <!-- Javadoc allows this -->
  211.     <SEQ TYPE="COMMENT3"><</SEQ>
  212.  
  213.     <KEYWORDS>
  214.       <LABEL>@author</LABEL>
  215.       <LABEL>@beaninfo</LABEL>
  216.       <LABEL>@history</LABEL>
  217.       <LABEL>@bug</LABEL>
  218.       <LABEL>@review</LABEL>
  219.       <LABEL>@todo</LABEL>
  220.       <LABEL>@idea</LABEL>
  221.       <LABEL>@pre</LABEL>
  222.       <LABEL>@requires</LABEL>
  223.       <LABEL>@post</LABEL>
  224.       <LABEL>@ensures</LABEL>
  225.       <LABEL>@generates</LABEL>
  226.       <LABEL>@modifies</LABEL>
  227.       <LABEL>@invariant</LABEL>
  228.       <LABEL>@exception</LABEL>
  229.       <LABEL>@hides</LABEL>
  230.       <LABEL>@overrides</LABEL>
  231.       <LABEL>@equivalent</LABEL>
  232.       <LABEL>@bon</LABEL>
  233.       <LABEL>@access</LABEL>
  234.       <LABEL>@example</LABEL>
  235.       <LABEL>@design</LABEL>
  236.       <LABEL>@serial</LABEL>
  237.       <LABEL>@references</LABEL>
  238.       <LABEL>@uses</LABEL>
  239.       <LABEL>@guard</LABEL>
  240.       <LABEL>@values</LABEL>
  241.       <LABEL>@complexity</LABEL>
  242.       <LABEL>@deprecated</LABEL>
  243.       <LABEL>@docRoot</LABEL>
  244.       <LABEL>@exception</LABEL>
  245.       <LABEL>@link</LABEL>
  246.       <LABEL>@param</LABEL>
  247.       <LABEL>@return</LABEL>
  248.       <LABEL>@see</LABEL>
  249.       <LABEL>@serialData</LABEL>
  250.       <LABEL>@serialField</LABEL>
  251.       <LABEL>@since</LABEL>
  252.       <LABEL>@throws</LABEL>
  253.       <LABEL>@version</LABEL>
  254.       <LABEL>@spec</LABEL>
  255.     </KEYWORDS>
  256.   </RULES>
  257.  
  258.   <RULES SET="SCALADOC_PRE" DEFAULT="COMMENT3" />
  259.   
  260.   <RULES SET="XML_SHARED">
  261.    <SPAN TYPE="COMMENT2">
  262.    <BEGIN><!--</BEGIN>
  263.    <END>--></END>
  264.    </SPAN>
  265.   
  266.    <SPAN TYPE="LITERAL3">
  267.    <BEGIN><?</BEGIN>
  268.    <END>?></END>
  269.    </SPAN>
  270.   
  271.    <SPAN MATCH_TYPE="LITERAL3" TYPE="COMMENT4">
  272.    <BEGIN><![CDATA[</BEGIN>
  273.    <END>]]></END>
  274.    </SPAN>
  275.     
  276.     <SEQ_REGEXP HASH_CHAR="<" TYPE="LITERAL3"><([\d\w_\-:.]+)(\s+[\d\w_\-:.]+=('[^']*'|"[^"]*"))*\s*/\s*></SEQ_REGEXP>
  277.     
  278.     <SPAN_REGEXP DELEGATE="XML_LITERAL" HASH_CHAR="<" MATCH_TYPE="LITERAL3" TYPE="NULL">
  279.      <BEGIN><([\d\w_\-:.]+)(\s+[\d\w_\-:.]+=('[^']*'|"[^"]*"))*\s*></BEGIN>
  280.      <END></$1></END>
  281.     </SPAN_REGEXP>
  282.   </RULES>
  283.   
  284.   <!-- TODO find a way to highlight attribute names as LABEL, attribute values as LITERAL1 -->
  285.   <RULES SET="XML_LITERAL" DEFAULT="COMMENT4">
  286.    <PROPS>
  287. <PROPERTY NAME="commentStart" VALUE="<!--" />
  288. <PROPERTY NAME="commentEnd" VALUE="-->" />
  289. <PROPERTY NAME="lineComment" VALUE="" />
  290.    </PROPS>
  291.   
  292.    <IMPORT DELEGATE="XML_SHARED"/>
  293.   
  294.     <SPAN DELEGATE="MAIN">
  295.       <BEGIN>{</BEGIN>
  296.       <END>}</END>
  297.     </SPAN>
  298.     
  299.     <SPAN TYPE="LABEL" NO_WORD_BREAK="TRUE">
  300.      <BEGIN>&</BEGIN>
  301.      <END>;</END>
  302.     </SPAN>
  303.     
  304.     <SEQ_REGEXP HASH_CHAR="<" TYPE="INVALID"></[\d\w_\-:.]+></SEQ_REGEXP> <!-- unmatched closing tags -->
  305.   </RULES>
  306. </MODE>